﻿using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using AutofactMVC.Models;

namespace AutofactMVC.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            IEnumerable<Student> students;
            using (var context = new SchoolContext())
            {
                students = context.Students.ToList();
            }
            return View(students);
        }

     
    }
}
